package team.fivez.defaultmanage.dao;


import team.fivez.defaultmanage.domain.DefaultApplication;
import team.fivez.defaultmanage.domain.IndustryInfo;
import team.fivez.defaultmanage.domain.RegionInfo;

import java.sql.Timestamp;
import java.util.List;

public interface DefaultApplicationDao {

    //插入申请表信息
    int insertDefaultApplication(DefaultApplication defaultApplication);

    //根据客户名查找违约申请单信息
    DefaultApplication getDefaultApplicationByCustomerName(String customerName);


    //根据审核状态查看申请单信息列表
    List<DefaultApplication> getListByApprovementStatusAndApplicantAccount(int approvementStatus,String applicantAccount);

    //根据客户名称和申请人查看申请单信息列表
    List<DefaultApplication> getListByCustomerNameAndApplicantAccount(String customerName,String applicantAccount);

    //全部的违约申请清单
    List<DefaultApplication> getAllList();


    //根据审核状态查找违约单信息列表
    List<DefaultApplication> getListByApprovementStatus(int approvementStatus);

    //根据申请人账号获取所有的申请表
    List<DefaultApplication> getListByApplicantAccount(String applicantAccount);


    //根据客户名称查找违约单信息列表
    List<DefaultApplication> getListByCustomerName(String customerName);

    //更改审核状态
    void updateApprovementStatusByApplicationNumber(int approvementStatus,String applicationNumber);


    //根据申请单号进行查找
    DefaultApplication getDefaultApplicationByNumber(String number);

    //更改申请单的重生标记
    void updateRedoStatusByApplicationNumber(String applicationNumber,int status);

    //更新审核时间
    void updateApplicationTimeByApplicationNumber(String applicationNumber, Timestamp approvementTime);

    //更新审核人姓名
    void updateDefaultApproverNameByApplicationNumber(String applicationNumber,String defaultApproverName);

    //查询申请单有没有该用户的申请单（用于统计）
    Integer selectCountByName(String customerName);

    //从视图industry_default视图当中获取
    List<IndustryInfo> getDefaultIndustryInfo();

    //从视图region_default视图当中获取
    List<RegionInfo> getDefaultRegionInfo();

}
